<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>UFT Login</title>
<link rel="stylesheet" href="js/jquery/themes/start/jquery-ui-1.10.3.custom.css" />
<script src="js/jquery/jquery-1.9.1.js"></script>
<script src="js/jquery/jquery-ui-1.10.3.custom.js"></script>

<link rel="stylesheet" href="style.css" />
<script>
var options = { 
        //target:        '#output2',   // target element(s) to be updated with server response 
       // beforeSubmit:  showRequest,  // pre-submit callback 
        //success:       showResponse,  // post-submit callback 
 
        // other available options: 
        //url:       login.jsp         // override for form's 'action' attribute 
        //type:      type        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        //clearForm: true        // clear all form fields after successful submit 
        //resetForm: true        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
  $(function() {
    $( "#loginDialog" ).dialog({
    	autoOpen: true,
    	modal: true,
    	buttons: [
    		{	
    			 text: "Ok",
    			 click: function() {
    			 	$('#loginForm').submit();
    		  }
    		 } 
    		
    	],
    	
    });
  });
  </script>
</head>
<body>
<div id="loginDialog" title="Login">
<sec:authorize access="!isAuthenticated()">
	<c:if test="${loginFailed}">
	   <div style="color: red">Could not sign in, please check your login/password...</div>
    </c:if>  
	<form id="loginForm" action="j_spring_security_check" method="post">
	<fieldset>
		<span id="errorMessage"></span>
		<label for="username">Username</label>
		<input type="text" name="j_username" id="j_username" class="text ui-widget-content ui-corner-all" />
		<label for="password">Password</label>
		<input type="password" name="j_password" id="j_password" value="" class="text ui-widget-content ui-corner-all" />
	</fieldset>
	</form>
</sec:authorize>
	
</div>
</body>
</html>